﻿using System;
using System.Data;

namespace Aragorn.SOA.ORM
{
    public class DbContextData
    {
        public DbContextData()
        {
            this.UseTransaction = false;
            this.IsolationLevel = IsolationLevel.ReadCommitted;
            this.CommandTimeout = null;
        }


        public int? CommandTimeout
        {

            get;

            set;
        }

        public IDbConnection Connection
        {
            get;
            set;
        }


        public string ConnectionString
        {

            get;

            set;
        }

        public IsolationLevel IsolationLevel
        {
            get;
            set;
        }


        public Action<ConnectionEventArgs> OnConnectionClosed
        {

            get;

            set;
        }


        public Action<ConnectionEventArgs> OnConnectionOpened
        {
            get;
            set;
        }

        public Action<ConnectionEventArgs> OnConnectionOpening
        {
            get;
            set;
        }


        public Action<CommandEventArgs> OnExecuted
        {

            get;

            set;
        }


        public Action<CommandEventArgs> OnExecuting
        {

            get;

            set;
        }


        public IDbTransaction Transaction
        {

            get;

            set;
        }


        public bool UseTransaction
        {

            get;

            set;
        }
    }
}